/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ifpb.pod.model;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Diogenes
 */


@Embeddable
public class ContaUsuario implements Serializable {

    private String login;
    private String senha;

    public ContaUsuario() {
    }

    public ContaUsuario(String login, String senha) {
        this.login = login;
        this.senha = senha;
    }


    @Column(unique=true)
    public String getLogin() {
        return login;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    public String getSenha() {
        return senha;
    }

    public void setSenha(String senha) {
        this.senha = senha;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final ContaUsuario other = (ContaUsuario) obj;
        if ((this.login == null) ? (other.login != null) : !this.login.equals(other.login)) {
            return false;
        }
        if ((this.senha == null) ? (other.senha != null) : !this.senha.equals(other.senha)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 23 * hash + (this.login != null ? this.login.hashCode() : 0);
        hash = 23 * hash + (this.senha != null ? this.senha.hashCode() : 0);
        return hash;
    }
}
